/*
 * SelectInterrupter.h
 *
 *  Created on: Jun 29, 2016
 *      Author: Lucifer
 */

#ifndef BFX_NET_SELECTPOLLER_H_
#define BFX_NET_SELECTPOLLER_H_

#include "./Socket.h"
#include <map>

namespace BFX {

class SelectInterrupter {
public:
	SelectInterrupter();
	~SelectInterrupter();

	bool isValid() const {
		return (_reader != NULL && _writer != NULL);
	}
	bool interrupt();
	bool reset();
	fildes_t getReadDescriptor();

private:
	REF<Socket> _reader;
	REF<Socket> _writer;
};

} /* namespace BFX */

#endif /* BFX_NET_SELECTPOLLER_H_ */
